class CreatePosts < ActiveRecord::Migration[5.0]
  def change
    create_table :posts do |t|
      t.string :slug
      t.string :title
      t.text :body
      t.integer :user_id
      t.integer :parent_id
      t.datetime :version
      t.integer :main_id

      t.timestamps
    end
    add_index :posts, :slug, unique: true
    add_index :posts, :user_id
  end
end
